package avicit.bdp.dgs.mdm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.bdp.dgs.mdm.utils.enums.MdmCodeTypeEnum;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.apache.commons.lang3.StringUtils;

@ApiModel(value = "MdmRuleConfigDTO", description = "主数据管理编码配置")
@Table(name = "bdp_dgs_mdm_rule_config")
public class MdmRuleConfigDTO extends BaseDTO {
  private static final long serialVersionUID = 1L;

  @Id
  @LogField
  @ApiModelProperty(value = "id", name = "id")
  @FieldRemark(column = "id", field = "id", name = "主键")
  @javax.persistence.Id
  @Column(name = "id")
  private String id;

  /** 分类ID */
  @ApiModelProperty(value = "分类ID", name = "typeId")
  @FieldRemark(column = "type_id", field = "typeId", name = "分类ID")
  private String typeId;

  /** 所属模型 */
  @ApiModelProperty(value = "所属模型", name = "modelId")
  @FieldRemark(column = "model_id", field = "modelId", name = "所属模型")
  private String modelId;

  /** 码段编码 */
  @ApiModelProperty(value = "码段编码", name = "code")
  @FieldRemark(column = "code", field = "code", name = "码段编码")
  private String code;

  /** 码段名称 */
  @ApiModelProperty(value = "码段名称", name = "name")
  @FieldRemark(column = "name", field = "name", name = "码段名称")
  private String name;

  /** 
   * 码段类型,固定码:GD,特征码:TZ,流水码:LS,日期码:RQ,引用码:YY,日期流水码:RL,特征流水码:TL,区间流水码:QL
   *
   * @see MdmCodeTypeEnum
   */
  @ApiModelProperty(
      value = "码段类型：固定码:GD,特征码:TZ,流水码:LS,日期码:RQ,引用码:YY,日期流水码:RL,特征流水码:TL,区间流水码:QL",
      name = "type")
  @FieldRemark(
      column = "type",
      field = "type",
      name = "码段类型,固定码:GD,特征码:TZ,流水码:LS,日期码:RQ,引用码:YY,日期流水码:RL,特征流水码:TL,区间流水码:QL")
  private String type;

  /** 码段描述 */
  @ApiModelProperty(value = "码段描述", name = "remark")
  @FieldRemark(column = "remark", field = "remark", name = "码段描述")
  private String remark;

  /** 固定码值 */
  @ApiModelProperty(value = "固定码值", name = "blockVal")
  @FieldRemark(column = "block_val", field = "blockVal", name = "固定码值")
  private String blockVal;

  /** 码段长度 */
  @ApiModelProperty(value = "码段长度", name = "length")
  @FieldRemark(column = "length", field = "length", name = "码段长度")
  private Long length;

  /** 码段关联属性(码段值与模型中的属性有关联关系) */
  @ApiModelProperty(value = "码段关联属性(码段值与模型中的属性有关联关系)", name = "blockFid")
  @FieldRemark(column = "block_fid", field = "blockFid", name = "码段关联属性(码段值与模型中的属性有关联关系)")
  private String blockFid;

  /** 起始值 */
  @ApiModelProperty(value = "起始值", name = "startVal")
  @FieldRemark(column = "start_val", field = "startVal", name = "起始值")
  private Long startVal;

  /** 步长 */
  @ApiModelProperty(value = "步长", name = "step")
  @FieldRemark(column = "step", field = "step", name = "步长")
  private Long step;

  /** 填充值 */
  @ApiModelProperty(value = "填充值", name = "fillVal")
  @FieldRemark(column = "fill_val", field = "fillVal", name = "填充值")
  private String fillVal;

  /** 是否当前时间(日期码中是否使用当前时间进行编码)(是:Y,否:N) */
  @ApiModelProperty(value = "是否当前时间(日期码中是否使用当前时间进行编码)(是:Y,否:N)", name = "isCurrDate")
  @FieldRemark(
      column = "is_curr_date",
      field = "isCurrDate",
      name = "是否当前时间(日期码中是否使用当前时间进行编码)(是:Y,否:N)")
  private String isCurrDate;

  /** 日期格式（YYYY、YY、YYYYMM、YYMM、YYYYMMDD、YYMMDD、MM、MMDD、DD） */
  @ApiModelProperty(
      value = "日期格式（YYYY、YY、YYYYMM、YYMM、YYYYMMDD、YYMMDD、MM、MMDD、DD）",
      name = "dateType")
  @FieldRemark(
      column = "date_type",
      field = "dateType",
      name = "日期格式（YYYY、YY、YYYYMM、YYMM、YYYYMMDD、YYMMDD、MM、MMDD、DD）")
  private String dateType;

  /** 引用数据模型(特征码、引用码中关联的模型) */
  @ApiModelProperty(value = "引用数据模型(特征码、引用码中关联的模型)", name = "refMid")
  @FieldRemark(column = "ref_mid", field = "refMid", name = "引用数据模型(特征码、引用码中关联的模型)")
  private String refMid;

  /** 引用数据元素(引用码引用的属性) */
  @ApiModelProperty(value = "引用数据元素(引用码引用的属性)", name = "refFid")
  @FieldRemark(column = "ref_fid", field = "refFid", name = "引用数据元素(引用码引用的属性)")
  private String refFid;

  /** 关联模型类型(M、D) */
  @ApiModelProperty(value = "关联模型类型(M、D)", name = "refType")
  @FieldRemark(column = "ref_type", field = "refType", name = "关联模型类型(M、D)")
  private String refType;

  /** 前缀 */
  @ApiModelProperty(value = "前缀", name = "preFix")
  @FieldRemark(column = "pre_fix", field = "preFix", name = "前缀")
  private String preFix;

  /** 后缀 */
  @ApiModelProperty(value = "后缀", name = "sufFix")
  @FieldRemark(column = "suf_fix", field = "sufFix", name = "后缀")
  private String sufFix;

  /** 码段是否定长(定长:Y,不定长:N) */
  @ApiModelProperty(value = "码段是否定长(定长:Y,不定长:N)", name = "isFixLength")
  @FieldRemark(column = "is_fix_length", field = "isFixLength", name = "码段是否定长(定长:Y,不定长:N)")
  private String isFixLength;

  /** 是否当前对象(是:Y,否:N) */
  @ApiModelProperty(value = "是否当前对象(是:Y,否:N)", name = "isCurObj")
  @FieldRemark(column = "is_cur_obj", field = "isCurObj", name = "是否当前对象(是:Y,否:N)")
  private String isCurObj;

  @Transient
  private String typeName;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getTypeId() {
    return typeId;
  }

  public void setTypeId(String typeId) {
    this.typeId = typeId;
  }

  public String getModelId() {
    return modelId;
  }

  public void setModelId(String modelId) {
    this.modelId = modelId;
  }

  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public String getBlockVal() {
    return blockVal;
  }

  public void setBlockVal(String blockVal) {
    this.blockVal = blockVal;
  }

  public Long getLength() {
    return length;
  }

  public void setLength(Long length) {
    this.length = length;
  }

  public String getBlockFid() {
    return blockFid;
  }

  public void setBlockFid(String blockFid) {
    this.blockFid = blockFid;
  }

  public Long getStartVal() {
    return startVal;
  }

  public void setStartVal(Long startVal) {
    this.startVal = startVal;
  }

  public Long getStep() {
    return step;
  }

  public void setStep(Long step) {
    this.step = step;
  }

  public String getFillVal() {
    return fillVal;
  }

  public void setFillVal(String fillVal) {
    this.fillVal = fillVal;
  }

  public String getIsCurrDate() {
    return isCurrDate;
  }

  public void setIsCurrDate(String isCurrDate) {
    this.isCurrDate = isCurrDate;
  }

  public String getDateType() {
    return dateType;
  }

  public void setDateType(String dateType) {
    this.dateType = dateType;
  }

  public String getRefMid() {
    return refMid;
  }

  public void setRefMid(String refMid) {
    this.refMid = refMid;
  }

  public String getRefFid() {
    return refFid;
  }

  public void setRefFid(String refFid) {
    this.refFid = refFid;
  }

  public String getRefType() {
    return refType;
  }

  public void setRefType(String refType) {
    this.refType = refType;
  }

  public String getPreFix() {
    return preFix;
  }

  public void setPreFix(String preFix) {
    this.preFix = preFix;
  }

  public String getSufFix() {
    return sufFix;
  }

  public void setSufFix(String sufFix) {
    this.sufFix = sufFix;
  }

  public String getIsFixLength() {
    return isFixLength;
  }

  public void setIsFixLength(String isFixLength) {
    this.isFixLength = isFixLength;
  }

  public String getIsCurObj() {
    return isCurObj;
  }

  public void setIsCurObj(String isCurObj) {
    this.isCurObj = isCurObj;
  }

  public String getTypeName() {
    return typeName;
  }

  public void setTypeName(String typeName) {
    this.typeName = typeName;
  }

  public String getLogFormName() {
    if (StringUtils.isEmpty(super.logFormName)) {
      return "bdp_dgs_mdm_rule_config";
    } else {
      return super.logFormName;
    }
  }

  public String getLogTitle() {
    if (StringUtils.isEmpty(super.logTitle)) {
      return "bdp_dgs_mdm_rule_config";
    } else {
      return super.logTitle;
    }
  }
}
